package hrms.util;

import org.apache.tomcat.util.codec.binary.Base64;
import java.security.MessageDigest;
import java.util.HashMap;
import java.util.Map;

public class PwdUtil
{
	/*
	 * 加密算法MD5
	 */
	public static String md5(String src)
	{
		try
		{
			MessageDigest md = MessageDigest.getInstance("MD5");
			byte[] output = md.digest(src.getBytes());
			String ret = Base64.encodeBase64String(output);
			return ret;
		}
		catch (Exception e)
		{
			throw new RuntimeException("密码加密失败");
		}
	}

	public static void main(String[] args)
	{
		System.out.println(md5("123"));
		Map<String, Integer> map = new HashMap<String, Integer>();
		map.put("1", 2);

		for (String set : map.keySet())
		{
			Integer str = map.get(set);
		}
		
		
		
		
	}
}
